Skip to content

Break NominalWordWrap at every Unicode mandatory line break [patch] - #185

Open
matt-edmondson wants to merge 1 commit into
mainfrom
fix/184-wordwrap-mandatory-breaks
Open

matt-edmondson wants to merge 1 commit into
mainfrom
fix/184-wordwrap-mandatory-breaks

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

NominalWordWrap treated only CR/LF as forced breaks, so U+2028, U+2029, NEL, form feed and vertical tab reached SplitAtBreakingWhiteSpace as ordinary whitespace and the lines they separated were merged.

Change

  • NominalWordWrapIterator now splits segments, after the existing Unix normalisation, on \n, \v, \f, U+0085, U+2028 and U+2029 (the UAX Bump Microsoft.NET.Test.Sdk from 17.9.0 to 17.10.0 #14 BK and NL classes). Consecutive separators give a blank line, as \n\n does.
  • The <returns> doc lists the extra breaks.
  • NormalizeLineEndings/DetermineLineEndings are unchanged, as the issue suggested.

Tests

  • New data-row tests for each separator (two lines separated) and for a doubled separator (blank line kept).
  • With the source change reverted, all ten new rows fail. With it, the full suite passes (224/224, net10.0).

Open PRs #181 and #183 also edit NominalWordWrap, but in different places, so at most a small rebase may be needed.

Fixes #184


Generated by Claude Code

Split segments on vertical tab, form feed, NEL (U+0085), line separator
(U+2028) and paragraph separator (U+2029) as well as LF, so lines they
separate stay separate and consecutive ones keep a blank line, as \n\n does.

Fixes #184

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW63GiadYdzxagcfgyE
@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NominalWordWrap merges lines separated by U+2028, U+2029, NEL or form feed into one line ("Line one" LS "Line two" → "Line one Line two")

2 participants